<template>
	<!-- 面包屑导航 -->
  <div class="finalQues_a">
		<span>当前位置：</span>
		<span @click="linkTo('/')">首页<i class="el-icon-arrow-right"></i></span>
		<span @click="navTo(i.url)" :class="[navLength==index+1?'a_this':'']" v-for="(i,index) in item" :key="index">{{i.name}}<i v-if="navLength!=index+1" class="el-icon-arrow-right"></i></span>
  </div>
</template>

<script scoped>
  export default {
    name: 'crumbs',
		props: {
			item: {
				type: Array,
				required: true
			}
		},
		computed:{
			navLength(){
				return this.item.length
			}
		},
    data() {
      return {
      };
    },
    methods: {
			linkTo(url){
				this.$router.push(url);
			},
			navTo(url){
				this.$emit('crumbsClick',url)
			}
    }
  }
</script>
<style scoped>

</style>
